import { getWaitCheckStatementOrder } from '@/api/order'
import { ref } from 'vue'
import { WaitOrderStatementCheck } from '../types'

// 加载
const loading = ref(false)

// 工单待结单审核信息
const waitCheckStatementOrderInfo = ref<WaitOrderStatementCheck | null>(null)

/**
 * 获取工单待结单审核信息方法
 * @param {string} id - 工单id
 */
const get = async (id: string) => {
  loading.value = true
  const res = await getWaitCheckStatementOrder(id)
  waitCheckStatementOrderInfo.value = res.data.data.row
  loading.value = false
}

export default {
  loading,
  waitCheckStatementOrderInfo,
  get,
}
